package de.baumann.browser.present

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.OdinValue
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IOdinRecordView
import de.baumann.browser.model.UserModel

class OdinValuePresenter : BasePresenter<IOdinRecordView>() {

    fun getOdinRecord() {
        UserModel().getOdinRecord(view.startPage)
                .subscribe(object : OdinObserver<List<OdinValue>>(view) {
                    override fun onSuccess(data: List<OdinValue>?) {
                        if (data != null && view != null) {
                            view.setOdinList(data)
                        }
                    }
                })
    }
}